﻿using UtfprLibrary.Windows.Forms.ComponentModel;
using UtfprLibrary.Windows.Forms;
using UtfprLibrary.Windows.Forms.Exceptions;
using System;

namespace UtfprLibrary.Windows.Helpers {
    /// <summary>
    /// Initiate instance of SplashScreen
    /// </summary>
    public static class UtfprSplashBaseHelper {
        /// <summary>
        /// Displays the splashscreen
        /// </summary>
        internal static void ShowSplashScreen() {
            try {
                UtfprApplication.Instance.FormSplashDefault.ShowSplashScreen();
            } catch (Exception ex) {
                throw new UtfprWFCoreHelpersException("", ex);
            }
        }

        /// <summary>
        /// Closes the SplashScreen
        /// </summary>
        public static void CloseSplashScreen() {
            try {
                UtfprApplication.Instance.FormSplashDefault.CloseSplashScreen();
                //UtfprApplication.Instance.FormMainDefault.WindowState = FormWindowState.Maximized;
                //UtfprApplication.Instance.FormMainDefault.ShowInTaskbar = true;
            } catch (Exception ex) {
                throw new UtfprWFCoreHelpersException("", ex);
            }
        }

        /// <summary>
        /// Update text with message color defined as black/green/yellow/red/ for info/success/warning/failure
        /// </summary>
        /// <param name="Text">Message</param>
        /// <param name="tom">Type of Message</param>
        public static void UdpateStatus(string Text, SplashMessageTypeEnum tom) {
            try {
                UtfprApplication.Instance.FormSplashDefault.UdpateStatus(Text, tom);
            } catch (Exception ex) {
                throw new UtfprWFCoreHelpersException("", ex);
            }
        }
    }
}
